﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

namespace MrPP.SerriedCabinet
{
    public class WindowModel : NetworkBehaviour 
    {
        public enum State { 
            Start,
            Main,
        //    None,
        }
        [SyncVar(hook ="changeState")]
        public State state = State.Start;
        public void changeState(State val) {
            state = val;
            onChanged?.Invoke();
        }
        public Action onChanged
        {
            get;
            set;
        }


        [SyncVar(hook = "changeSelected")]
        public int selected = -1;

        public void changeSelected(int val)
        {

            onSelected?.Invoke(selected, val);
            selected = val;
        }

        public Action<int, int> onSelected {
            get;
            set;
        }
    }
}